from fastapi import FastAPI, Request
from loguru import logger


def init_middleware(app: FastAPI):
	@app.middleware("http")
	async def log_url(request: Request, call_next):
		logger.info(f"request.url = {request.url}")
		response = await call_next(request)
		return response
